﻿namespace Harness.Recording
{
    using System;

    internal static class SourceCodeFormatterFactory
    {
        internal static ISourceCodeFormatter CreateSourceFomatter(string languageType)
        {
            switch (languageType.Trim().ToLower())
            {
                case "":
                    return new SourceCodeFormatters.DefaultSourceCodeFormmater();

                case "powershell":
                case "ps1":
                    return new SourceCodeFormatters.PowerShellSourceCodeFormmater();

                case "javascript":
                case "jscript":
                case "js":
                    return new SourceCodeFormatters.JavaScriptSourceCodeFormmater();

                case "visualbasic":
                case "vb":
                case "vbs":
                case "vba":
                    return new SourceCodeFormatters.VisualBasicSourceCodeFormmater();

                case "csharp":
                case "c#":
                case "cs":
                    return new SourceCodeFormatters.CSharpSourceCodeFormmater();

                case "python":
                case "py":
                    return new SourceCodeFormatters.PythonSourceCodeFormmater();

                default:
                    throw new ArgumentOutOfRangeException(languageType);
            }
        }
    }
}
